fix: migrate SharedTopicClient to raw topic API - #1
Open
Jiu-xiao wants to merge 1 commit into
Open
Conversation
Reviewer's GuideMigrates SharedTopicClient to libxr’s new raw topic callback and MPMCQueue-based packet buffering, updating topic packing to use Topic::PackRaw and modern Topic APIs while aligning the README with the new queueing and raw packet path behavior. Sequence diagram for raw topic callback and MPMCQueue-based forwardingsequenceDiagram
actor TopicPublisher
participant LibXR_Topic
participant SharedTopicClient
participant MPMCQueue_ready as MPMCQueue_ready_packets
participant UART_WritePort
TopicPublisher->>LibXR_Topic: Publish
LibXR_Topic->>SharedTopicClient: raw_topic_callback(timestamp, ConstRawData)
SharedTopicClient->>SharedTopicClient: OnTopic(in_isr, CallbackInfo, timestamp, ConstRawData)
SharedTopicClient->>LibXR_Topic: Topic(info.topic).PackRaw(ConstRawData, PacketSlot.buffer, timestamp)
alt [PackRaw == ErrorCode::OK]
SharedTopicClient->>MPMCQueue_ready: Push(ReadyPacket)
alt [Push == ErrorCode::OK]
SharedTopicClient->>SharedTopicClient: TxService(in_isr)
SharedTopicClient->>MPMCQueue_ready: Pop(ReadyPacket)
alt [Pop == ErrorCode::OK]
SharedTopicClient->>UART_WritePort: [enqueue packet to WritePort]
else [Pop != ErrorCode::OK]
SharedTopicClient->>SharedTopicClient: ReturnFreeSlot(slot_index)
end
else [Push != ErrorCode::OK]
SharedTopicClient->>SharedTopicClient: ReturnFreeSlot(slot_index)
end
else [PackRaw != ErrorCode::OK]
SharedTopicClient->>SharedTopicClient: ReturnFreeSlot(slot_index)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Topic::PackRaw(...)APILockFreeQueue/LockFreePoolusage withMPMCQueueTopic(topic).PayloadSize()instead of old internal topic block fieldsTopicHandlein callback contextDependency
Requires libxr master at or after
5728458(feat(message): add raw topic callback and packet API).Validation
/tmp/libxr_raw_topic_sharedtopic_smoke2_20260630T010357Z: patched libxr + patched SharedTopicClient constructor/publish smoke passed/tmp/libxr_raw_topic_module_smoke2_20260630T010424Z/smoke_raw_topic_20260630T010430Z: dependency-closure smoke result48 PASS / 8 FAIL;xrobot-org/SharedTopicClientpassedSummary by Sourcery
Align SharedTopicClient with the latest libxr raw topic and queue APIs while preserving multi-topic UART forwarding behavior.
Bug Fixes:
Enhancements:
Documentation: